package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.SystemSmsCode;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-01
* description:手机验证码
*/
@Data
public class SystemSmsCodeDto extends BaseField {

    @ApiModelProperty(value = "编号")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "验证码")
    private String code;

    @ApiModelProperty(value = "创建 IP")
    private String createIp;

    @ApiModelProperty(value = "发送场景")
    private Integer scene;

    @ApiModelProperty(value = "今日发送的第几条")
    private Integer todayIndex;

    @ApiModelProperty(value = "是否使用")
    private Integer used;

    @ApiModelProperty(value = "使用时间")
    private Date usedTime;

    @ApiModelProperty(value = "使用 IP")
    private String usedIp;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public SystemSmsCode invertEntity(){
        SystemSmsCode dto = new SystemSmsCode();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setMobile(this.getMobile());
        dto.setCode(this.getCode());
        dto.setCreateIp(this.getCreateIp());
        dto.setScene(this.getScene());
        dto.setTodayIndex(this.getTodayIndex());
        dto.setUsed(this.getUsed());
        dto.setUsedTime(this.getUsedTime());
        dto.setUsedIp(this.getUsedIp());
        return dto;
    }
}
